<template>
  <div class="myInput">
    <input type="text" :value="modelValue" @input="inputChange" name="" id="" />
  </div>
</template>
<script>
import { ref, reactive, toRefs, computed } from "vue";
import { useRouter, useRoute } from "vue-router";
import { useStore } from "vuex";
export default {
  props: ["modelValue"],
  name: "myInput",
  setup(props, ctx) {
    /* 定义仓库 */
    const store = useStore();
    /* 定义路由传参 */
    const router = useRouter();
    /* 定义路由收参 */
    const route = useRoute();
    /* 定义总数据存放地址 */
    const data = reactive({
      inputChange: (e) => {
        ctx.emit("update:modelValue", e.target.value);
      },
    });
    return { ...toRefs(data) };
  },
  components: {},
};
</script>
<style lang="scss">
/* 如果不想样式污染  就加个scoped */
</style>